<template>
	<div class="topandleft" id="topandleft" style="position: fixed; top: 0; left: 0; z-index: 999; width: 100%; padding: 0.2rem; height: 1rem; background: #fff;">
    <div class="flexbc">
      <div class="flex">
        <div  @click="showPopup"><img src="../../static/img/tl1.png" style="width: 0.5rem; height: 0.5rem; margin-right: 0.2rem;"></div>
        <!-- <div><img src="../../static/img/tl2.png" style="width: 0.5rem; height: 0.5rem;"></div> -->
      </div>
      <!-- <div>
        <div><img src="../../static/img/toux.png" style="width: 0.5rem; height: 0.5rem;"></div>
      </div> -->
    </div>

    <van-popup v-model="show" position="left">
      <div style="min-height: 100vh; width: 5rem; padding: 0.3rem; background: rgb(246, 248, 251);">
        <div style="background: #fff; padding: 0.3rem 0.3rem 0; border-radius: 0.2rem;">
          <div class="flex">
            <div><img src="../../static/img/shangpinguanli.svg" style="width: 0.35rem; height: 0.35rem;"></div>
            <div style="flex: 1; margin-left: 0.25rem;">
              <div style="height: 0.9rem; font-size: 0.28rem;">
                商品管理
              </div>
              <!-- <div style="line-height: 0.9rem; border-top: 1px #eaeaea solid; width: 100%;font-size: 0.28rem;">
                <div class="flexbc">
                  <div><router-link to="/shangpinguanli/gongyingshangshangpin">供应商商品</router-link></div>
                  <div><i class="el-icon-arrow-right"></i></div>
                </div>

              </div> -->
              <div style="line-height: 0.9rem; border-top: 1px #eaeaea solid; width: 100%;font-size: 0.28rem;">

                <div class="flexbc">
                  <div><router-link to="/shangpinguanli/zaishoushangpin">在售商品</router-link></div>
                  <div><i class="el-icon-arrow-right"></i></div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- <div style="background: #fff; padding: 0.3rem 0.3rem 0; border-radius: 0.2rem; margin-top: 0.2rem;">
          <div class="flex">
            <div><img src="../../static/img/zhibotuiguang.svg" style="width: 0.35rem; height: 0.35rem;"></div>
            <div style="flex: 1; margin-left: 0.25rem;">
              <div style="height: 0.9rem; font-size: 0.28rem;">
                直播推广
              </div>
              <div style="line-height: 0.9rem; border-top: 1px #eaeaea solid; width: 100%;font-size: 0.28rem;">
                <div class="flexbc">
                  <div><router-link to="/zhibotuiguang/duoshangpin">多商品页</router-link></div>
                  <div><i class="el-icon-arrow-right"></i></div>
                </div>

              </div>
              <div style="line-height: 0.9rem; border-top: 1px #eaeaea solid; width: 100%;font-size: 0.28rem;">
                <div class="flexbc">
                  <div><router-link to="/zhibotuiguang/danshangpin">单商品页</router-link></div>
                  <div><i class="el-icon-arrow-right"></i></div>
                </div>

              </div>
            </div>
          </div>
        </div> -->

        <!-- <div style="background: #fff; padding: 0.3rem; border-radius: 0.2rem; margin-top: 0.2rem;">
          <div class="flex" @click="go('/fenxiaoshangguanli')">
            <div><img src="../../static/img/fenxiaoshangguanli.svg" style="width: 0.35rem; height: 0.35rem;"></div>
            <div style="flex: 1; margin-left: 0.25rem;">
              <div style=" font-size: 0.28rem;">
                <div class="flexbc">
                  <div>分销商管理</div>
                  <div><i class="el-icon-arrow-right"></i></div>
                </div>
              </div>
            </div>
          </div>
        </div> -->

        <div style="background: #fff; padding: 0.3rem 0.3rem 0; border-radius: 0.2rem; margin-top: 0.2rem;">
          <div class="flex">
            <div><img src="../../static/img/dingdanguanli.svg" style="width: 0.35rem; height: 0.35rem;"></div>
            <div style="flex: 1; margin-left: 0.25rem;">
              <div style="height: 0.9rem; font-size: 0.28rem;">
                分销商管理
              </div>
              <div style="line-height: 0.9rem; border-top: 1px #eaeaea solid; width: 100%;font-size: 0.28rem;">
                <router-link to="/fenxiaoshangguanli/fenxiaoshangguanli">
                  <div class="flexbc">
                    <div>分销商管理</div>
                    <div><i class="el-icon-arrow-right"></i></div>
                  </div>
                </router-link>
              </div>
              <div style="line-height: 0.9rem; border-top: 1px #eaeaea solid; width: 100%;font-size: 0.28rem;">
                <router-link to="/fenxiaoshangguanli/zhaomufenxiaoyuan">
                  <div class="flexbc">
                    <div>招募分销员</div>
                    <div><i class="el-icon-arrow-right"></i></div>
                  </div>
                </router-link>
              </div>
            </div>
          </div>
        </div>


        <div style="background: #fff; padding: 0.3rem 0.3rem 0; border-radius: 0.2rem; margin-top: 0.2rem;">
          <div class="flex">
            <div><img src="../../static/img/dingdanguanli.svg" style="width: 0.35rem; height: 0.35rem;"></div>
            <div style="flex: 1; margin-left: 0.25rem;">
              <div style="height: 0.9rem; font-size: 0.28rem;">
                订单管理
              </div>
              <div style="line-height: 0.9rem; border-top: 1px #eaeaea solid; width: 100%;font-size: 0.28rem;">
                <router-link to="/dingdanguanli/dingdanchuli">
                  <div class="flexbc">
                    <div>我的订单</div>
                    <div><i class="el-icon-arrow-right"></i></div>
                  </div>
                </router-link>
              </div>


              <div v-if="fxs_display == 1" style="line-height: 0.9rem; border-top: 1px #eaeaea solid; width: 100%;font-size: 0.28rem;">
                <div class="flexbc">
                  <div><router-link to="/dingdanguanli/fenxiaoshangdingdan">分销商订单</router-link></div>
                  <div><i class="el-icon-arrow-right"></i></div>
                </div>
              </div>
            </div>
          </div>
        </div>

        <div style="background: #fff; padding: 0.3rem 0.3rem 0; border-radius: 0.2rem; margin-top: 0.2rem;">
          <div class="flex">
            <div><img src="../../static/img/caiwuguanli.svg" style="width: 0.35rem; height: 0.35rem;"></div>
            <div style="flex: 1; margin-left: 0.25rem;">
              <div style="height: 0.9rem; font-size: 0.28rem;">
                财务管理
              </div>

              <div style="line-height: 0.9rem; border-top: 1px #eaeaea solid; width: 100%;font-size: 0.28rem;">
                <router-link to="/yongjin/yongjinshouru">
                  <div class="flexbc">
                    <div>佣金收入结算</div>
                    <div><i class="el-icon-arrow-right"></i></div>
                  </div>
                </router-link>
              </div>
              <div style="line-height: 0.9rem; border-top: 1px #eaeaea solid; width: 100%;font-size: 0.28rem;">
                <router-link to="/yongjin/yongjintixian">
                  <div class="flexbc">
                    <div>佣金提现</div>
                    <div><i class="el-icon-arrow-right"></i></div>
                  </div>
                </router-link>
              </div>
              <div style="line-height: 0.9rem; border-top: 1px #eaeaea solid; width: 100%;font-size: 0.28rem;">
                <router-link to="/yongjin/yongjinbaobiao">
                  <div class="flexbc">
                    <div>佣金报表</div>
                    <div><i class="el-icon-arrow-right"></i></div>
                  </div>
                </router-link>
              </div>

            </div>
          </div>
        </div>

        <!-- <div style="background: #fff; padding: 0.3rem; border-radius: 0.2rem; margin-top: 0.2rem;">
          <div class="flex" @click="go('/xitongpeizhi')">
            <div><img src="../../static/img/xitongpeizhi.svg" style="width: 0.35rem; height: 0.35rem;"></div>
            <div style="flex: 1; margin-left: 0.25rem;">
              <div style=" font-size: 0.28rem;">

                <div class="flexbc">
                  <div>系统配置</div>
                  <div><i class="el-icon-arrow-right"></i></div>
                </div>
              </div>
            </div>
          </div>
        </div> -->
      </div>
    </van-popup>

	</div>
</template>

<script>
	export default {
		name: 'topandleft',
		data() {
			return {
        show:false,
        fxs_display:null
			}
		},
		created() {
      if(localStorage.getItem('shop_name')){
        document.title = localStorage.getItem('shop_name')
      }else{
        axios.get('/api/logo').then((response)=>{
        	if (response.data.msg.code == 0) {
            document.title = response.data.data.shop_name
            localStorage.setItem('shop_name',response.data.data.shop_name)
            localStorage.setItem('system_logo',response.data.data.system_logo)
            localStorage.setItem('left_logo',response.data.data.left_logo)
            localStorage.setItem('icp',response.data.data.icp)
        	} else {
        		this.$message.error(response.data.msg.info);
        	}
        })
      }
		},

		mounted() {
      var h = document.documentElement.clientWidth / 7.5 + 'px';
      document.documentElement.style.fontSize = h;

      this.fxs_display = JSON.parse(localStorage.getItem('user')).fxs_display
		},
		methods: {
      showPopup:function(){
        this.show = true;
      }
		}
	}
</script>


<style scoped lang="less">
  .router-link-active{ color: #005aff;}

</style>
